package com.yangcsoft.modules.deptmanage.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yangcsoft.common.utils.PageUtils;
import com.yangcsoft.common.utils.Query;

import com.yangcsoft.modules.deptmanage.dao.SalaryInfoDao;
import com.yangcsoft.modules.deptmanage.entity.SalaryInfoEntity;
import com.yangcsoft.modules.deptmanage.service.SalaryInfoService;


@Service("salaryInfoService")
public class SalaryInfoServiceImpl extends ServiceImpl<SalaryInfoDao, SalaryInfoEntity> implements SalaryInfoService {
    @Autowired
    private SalaryInfoDao dao;
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String key = params.get("key").toString();
        Page<SalaryInfoEntity> page = this.selectPage(
                new Query<SalaryInfoEntity>(params).getPage(),
                new EntityWrapper<SalaryInfoEntity>()
                                             .like("salary_no",key)
                 .or()
                                                             .like("userseq",key)
                 .or()
                                                             .like("pre_tax_salary",key)
                 .or()
                                                             .like("after_tax_salary",key)
                 .or()
                                                             .like("social_insurance_reduce_person_money",key)
                 .or()
                                                             .like("social_insurance_base",key)
                 .or()
                                                             .like("social_insurance_reduce_company_money",key)
                 .or()
                                                             .like("deposit_ratio",key)
                 .or()
                                                             .like("check_day",key)
                 .or()
                                                             .like("salary_day",key)
                 .or()
                                                             .like("create_date",key)
                 .or()
                                                             .like("create_user",key)
                 .or()
                                                             .like("update_date",key)
                 .or()
                                                            .like("update_user",key)
                                    );

        return new PageUtils(page);
    }

    @Override
    public void save(SalaryInfoEntity entity) {
        dao.save(entity);
    }


}
